<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>实时聊天室</title>
    <link rel="stylesheet" href="style.css" />
  </head>
  <body>
    <div class="chat-container">
      <div class="login-container" id="login-container">
        <h1>欢迎来到聊天室</h1>
        <input type="text" id="username-input" placeholder="输入用户名" />
        <button id="login-btn">进入聊天室</button>
        <p id="username-error" class="error-message"></p>
      </div>

      <div class="chat-room" id="chat-room" style="display: none">
        <div class="sidebar">
          <h2>在线用户</h2>
          <ul id="user-list"></ul>
        </div>
        <div class="main">
          <div class="messages" id="messages"></div>
          <div class="message-input">
            <input type="text" id="message-input" placeholder="输入消息..." />
            <button id="send-btn">发送</button>
          </div>
        </div>
      </div>
    </div>
    <script src="/socket.io/socket.io.js"></script>
    <script src="script.js"></script>
  </body>
</html>
